//**************************************************************************************
// Order Generated Class File
//**************************************************************************************
//**** DO NOT CHANGE THIS FILE.  THE CONTENTS WILL BE OVERRIDEN ON NEXT MODEL SAVE. ****
//**************************************************************************************
using System;
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;
using DevExpress.Xpo;

namespace Demo.Module
{
	[ImageName("BO_Unknown")]
	[CreatableItem(true)]
	[NavigationItem(true)]
	[DefaultListViewOptions()]
	public partial class Order : XPLiteObject
	{
		public Order() : base()
		{
		}

		public Order(Session session) : base(session)
		{
		}

		private Int32 m_id;
		[Key(true)]
		public Int32 Id
		{
			get { return m_id; }
			set { SetPropertyValue("Id", ref m_id, value); }
		}

		private DateTime m_orderDate;
		[Size(50)]
		[RuleRequiredField("Order_OrderDate_RuleRequiredField", DefaultContexts.Save, "Order date is required.")]
		public DateTime OrderDate
		{
			get { return m_orderDate; }
			set { SetPropertyValue("OrderDate", ref m_orderDate, value); }
		}

		private Customer m_customer;
		[Aggregated]
		[Association("BusinessModel.CustomerOrder")]
		public Customer Customer
		{
			get { return m_customer; }
			set { SetPropertyValue("Customer", ref m_customer, value); }
		}

		[Association("BusinessModel.OrderOrderDetail")]
		[Aggregated]
		public XPCollection<OrderDetail> OrderDetails
		{
		    get
		    {
    		    return GetCollection<OrderDetail>("OrderDetails");
		    }
		}

	}
}
